<?php
use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;

/**
 * @var \yii\web\View $this
 * @var string $content
 */
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
    <?php $this->beginBody() ?>
    <div id="wrapper">
        <?php
            NavBar::begin([
                'brandLabel' => Yii::t('app', 'Stores.vn'),
                'brandUrl' => Yii::$app->homeUrl,
                'options' => [
//                    'class' => 'navbar-inverse navbar-fixed-top',
                    'class' => 'navbar navbar-default navbar-static-top',
                    'style' => 'margin-bottom: 0',
                ],
                'renderInnerContainer' => false,
            ]);
            $menuItems = [
                [
                    'label' => '<i class="fa fa-user fa-fw"></i>',
                    'url' => '#',
                    'items' => [
//                        [
//                            'label' => '<i class="fa fa-user fa-fw"></i> User Profile',
//                            'url' => '#',
//                        ],
//                        [
//                            'label' => '<i class="fa fa-gear fa-fw"></i> Settings',
//                            'url' => '#',
//                        ],
                        [
                            'label' => '<i class="fa fa-sign-out fa-fw"></i> Logout',
                            'url' => array('site/logout'),
                        ]
                    ],
                ],
            ];

//            $menuItems[] = [
//                'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
//                'url' => ['/site/logout'],
//                'linkOptions' => ['data-method' => 'post']
//            ];

            echo Nav::widget([
                'options' => ['class' => 'nav navbar-top-links navbar-right'],
                'encodeLabels' => false,
                'items' => $menuItems,
            ]);
            NavBar::end();
        ?>
        <!-- /.navbar-static-top -->

        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li>
                        <a href="<?= Yii::$app->urlManager->createUrl(array('/site/index')) ?>"><i class="fa fa-dashboard fa-fw"></i> <?= Yii::t('app', 'Dashboard') ?></a>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i>  <?= Yii::t('app', 'Category') ?><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="<?= Yii::$app->urlManager->createUrl(array('/category/index')) ?>"><i class="fa fa-list-ul fa-fw"></i> <?= Yii::t('app', 'List Category') ?></a>
                            </li>
                            <li>
                                <a href="<?= Yii::$app->urlManager->createUrl(array('/category/create')) ?>"><i class="fa fa-plus fa-fw"></i> <?= Yii::t('app', 'New Category') ?></a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-location-arrow fa-fw"></i> <?= Yii::t('app', 'Location') ?><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="<?= Yii::$app->urlManager->createUrl(array('/location/index')) ?>"><i class="fa fa-list-ul fa-fw"></i> <?= Yii::t('app', 'List Location') ?></a>
                            </li>
                            <li>
                                <a href="<?= Yii::$app->urlManager->createUrl(array('/location/create')) ?>"><i class="fa fa-plus fa-fw"></i> <?= Yii::t('app', 'New Location') ?></a>
                            </li>
                        </ul>
                    </li>

                </ul>
                <!-- /#side-menu -->
            </div>
            <!-- /.sidebar-collapse -->
        </nav>
        <!-- /.navbar-static-side -->

        <div id="page-wrapper">
        <?php /*
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        */ ?>
        <?= $content ?>
        </div>
        <!-- /#page-wrapper -->
    </div>
    <!-- /#wrapper -->

    <footer class="footer">
    </footer>

    <?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
